<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>欢迎注册</title>
		<script type="text/javascript" src="/js/jquery-1.12.3.min.js"></script>
		<style>
		body{
			background:#DCDCDC;
		}
		.body{
			background: white;
			width:850px;
			height:600px;
			margin:20px 200px;
		}
		.login{
			padding:30px 400px;
			background: ;
		}
		.bt{
			font-size: 30px;
			padding-left: 330px;
		}
		.zh input{
			padding-left: 10px;
			width:350px;
			height:40px;
		}
		.zh{
			padding-left: 240px;
			margin-top:40px;
		}
		.mm input{
			padding-left: 10px;
			width:350px;
			height:40px;
		}
		.mm{
			padding-left: 240px;
			margin-top:20px;
		}
		.yzm{
			padding-left: 240px;
			margin-top:20px;			
		}
		.yzm input{
			width:150px;
			height:40px;			
		}
		.tj input{
			padding-left: 10px;
			width:360px;
			height:40px;
			font-size:25px;
			background-color:#F05D00;
		}
		.tj{
			padding-left: 240px;
			margin-top:20px;

		}
		.bottom{
			padding-left: 320px;
		}
		#login_sp1{
			color:red;
		}
		#login_sp2{
			color:red;
		}
		#login_sp3{
			color:red;
		}
		</style>
	</head>
	<body>
		<div class="body">
			<div class="login">
				<a href="{$Think.const.THINK_URL}"><image src="/images/m1.jpg" /></a>
			</div>
			<div class="bt">
				<b>小米账号注册</b>
			</div>
		<form method="post" action="{$Think.const.THINK_URL}/index/user/register">
			<div class="zh">
				<input type="text" name="username" id="login_t1" placeholder="手机号/小米账号/邮箱" />
				<span id="login_sp1"></span>
			</div>
			<div class="mm">
				<input type="password" name="password" id="login_t2" placeholder="密码" />
				<span id="login_sp2"></span>
			</div>
			<div class="mm">
				<input type="password" name="qrpassword" id="login_t3" placeholder="确认密码" />
				<span id="login_sp3"></span>
			</div>
			<div class="mm">
				<input type="text" name="email" placeholder="邮箱用来找回密码" />
			</div>

			<div class="tj">
				<input type="submit" name="denglu" value="立即注册" />
			</div>
		</form>
		</div>
		<div class="bottom">
			<p class="hz">小米公司版权所有-京ICP备10046444-<span></span>&ensp;&ensp;&ensp;&ensp;京公网安备11010802020134号-京ICP证110507</p>
		</div>
	<script>
		$(function(){

			$('#login_t1').blur(function(){
				var zh = $(this).val();
				$.ajax({
					type:'post',
					url:'{$Think.const.THINK_URL}/index/user/register1',
					data : "zhanghao="+zh,
					success:function(date){
						//date = JSON.parse(date);
						//alert(date);
						if(!date){
							console.log(date);
							$('#login_sp1').html("用户名未注册");
						} else {
							$('#login_sp1').html("用户名已经注册");
						}
					}

				})
			})
			$('#login_t2').blur(function(){
			    mima = $(this).val();
				$.ajax({
					type:'post',
					url:'{$Think.const.THINK_URL}/index/user/register2',
					data : "mima="+mima,
					success:function(date){
						//date = JSON.parse(date);
						//alert(date);
						if(date){
							//alert(date);
							$('#login_sp2').html('');
						} else {
							$('#login_sp2').html('密码不能为空');
						}
					}

				})
			})
			$('#login_t3').blur(function(){
				var qrmima = $(this).val();
				$.ajax({
					type:'post',
					url:'{$Think.const.THINK_URL}/index/user/register3',
					data : "qrmima="+qrmima,
					success:function(date){
						//date = JSON.parse(date);
						//alert(date);
						if(date == mima){

							$('#login_sp3').html('');
						} else {
							$('#login_sp3').html('两次密码不一致');
						}
					}

				})
			})
		})
	</script>
	</body>
</html>
